package uscdb.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import uscdb.pageModel.Json;
import uscdb.service.RepairServiceI;

/**
 * 修复bug 管理控制器
 */
@Controller
@RequestMapping("/repairController")
public class RepairController extends BaseController {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(RepairController.class);

	@Autowired
	private RepairServiceI repairService;

	@ResponseBody
	@RequestMapping("/repairLogicLinkToVersion")
	public Json repairLogicLinkToVersion() {
		Json json = new Json();
		try {
			repairService.repairLogicLinkToVersion();
			json.setMsg("successful!");
			json.setSuccess(true);
		} catch (Exception e) {
			json.setMsg("The system is broken..(>.<)..");
			logger.error(e.getMessage(), e);

		}
		return json;
	}

}
